import static com.github.llyb120.workflow.definition.All.*

workflow {
    id "flow10"

    startnode "发起", {
        dealer {
            byRoleName "管理员"
        }
        to "多人填写"
    }

    node "多人填写", {
        dealer {
            byRoleName "管理员","测试员"
        }
        maximumHandlers(5)
        to "会签通过", {
            expression { ctx ->
                return ctx.count("会签结果", "同意") >= 3
            }
        }

        to "发起", {
            expression { ctx ->
                return ctx.count("会签结果", "同意") < 3
            }
        }
    }

    node "会前通过", {
        dealer {
            byRoleName("管理员")
        }
        to "结束"
    }

    endnode "结束", {}

}